/**
 * 
 */
package vn.com.demand.lux.action;

import org.eclipse.jface.action.IAction;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindowActionDelegate;
import org.eclipse.ui.PartInitException;

import vn.com.demand.lux.view.WarrantyExpenseAccrual;

/**
 * @author Huynh Tan Tai <httcntt@yahoo.com>
 *
 */
public class OpenWarrantyExpenseAccrual extends BasicAction {
	
	public OpenWarrantyExpenseAccrual() {
	}

	/**
	 * The action has been activated. The argument of the
	 * method represents the 'real' action sitting
	 * in the workbench UI.
	 * @see IWorkbenchWindowActionDelegate#run
	 */
	public void run(IAction action) {
		// Get the active page.
		if (window == null)
			return;
		IWorkbenchPage page = window.getActivePage();
		if (page == null)
			return;
		// Open and activate the Favorites view.
		try {
			page.showView(WarrantyExpenseAccrual.ID);
		} catch (PartInitException e) {
			e.printStackTrace();
		}
	}
}